<?php 
namespace app\api\controller\v1;
use app\api\service\UserService;

class User extends Base {
    
    protected $service;
    public function __construct(UserService $service)
    {
        parent::__construct();
        $this->service = $service;
    }  
    
    public function getUser($page = 1, $size = 10) {
        return show(1, '成功', $this->service->page($page, $size), 200);
    }

    // 改变用户状态
    public function changeStatus() {
        return $this->service->changeStatus();
    }
    
    // 修改 添加
    public function save() {
        return $this->service->save();
    }

    // 退出
    public function logout() {
        return $this->service->logout();
    }
    // 获取用户信息
    public function getUserInfo() {
        return $this->service->getUserInfo();
    }
}